<?php defined('SYSPATH') OR die('No direct access allowed.');?>
<h2><?=$category['title']?></h2>
<? if (count($subcategories)>0) : ?>
<!-- BEGIN CATEGORY LIST -->
<ul class='cats list'>
  <li class="header"><p class="title"><?=Kohana::lang('category.subcategory_list')?></p></li>
	<? echo View::factory('forum/blocks/categories')->set('categories', $subcategories)?>
</ul>
<!-- END CATEGORY LIST -->
<? endif; ?>
<!-- BEGIN POST LIST -->
<ul class='posts list'>
  <li class='header'>
		<span class="title"><?=Kohana::lang('category.post_list')?></span>
		<? if ($acl->allowed('post', 'create')): ?>
		<span class='manage'>
			<?=html::anchor(Router::uri('forum', array('controller'=>'post', 'method'=>'add', 'id'=>$category['id'])), Kohana::lang('category.post_add'))?>
		</span>
		<? endif;?>
		<?=$pages?>
	</li>
<?
if (count($posts)>0):
	echo View::factory('forum/blocks/posts')->set('posts', $posts);
else: ?>
<li><?=Kohana::lang('category.post_list_empty')?></li>
<? endif;?>
</ul>
<!-- END POST LIST -->
